home *** CD-ROM | disk | FTP | other *** search
/ Sound Fx / Sound Fx.iso / Software / UNZIPED / MPW181-5 / _SETUP.1 / sublay1.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-19  |  2.8 KB  |  94 lines

  1. /*  sublay1.h
  2.  
  3.      Declarations for Layer I subband objects */
  4.  
  5. /*
  6.  *  @(#) subband_layer_1.h 1.6, last edit: 6/15/94 16:51:58
  7.  *  @(#) Copyright (C) 1993, 1994 Tobias Bading (bading@cs.tu-berlin.de)
  8.  *  @(#) Berlin University of Technology
  9.  *
  10.  *  This program is free software; you can redistribute it and/or modify
  11.  *  it under the terms of the GNU General Public License as published by
  12.  *  the Free Software Foundation; either version 2 of the License, or
  13.  *  (at your option) any later version.
  14.  *
  15.  *  This program is distributed in the hope that it will be useful,
  16.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  *  GNU General Public License for more details.
  19.  *
  20.  *  You should have received a copy of the GNU General Public License
  21.  *  along with this program; if not, write to the Free Software
  22.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  */
  24.  
  25. #ifndef SUBBAND_LAYER_1_H
  26. #define SUBBAND_LAYER_1_H
  27.  
  28. #include "all.h"
  29. #include "subband.h"
  30. #include "crc.h"
  31.  
  32.  
  33. // class for layer I subbands in single channel mode:
  34. class SubbandLayer1 : public Subband
  35. {
  36. protected:
  37.   uint32 subbandnumber;
  38.   uint32 samplenumber;
  39.   uint32 allocation;
  40.   real     scalefactor;
  41.   uint32 samplelength;
  42.   real     sample;
  43.   real     factor, offset;
  44.  
  45. public:
  46.        SubbandLayer1 (uint32 subbandnumber);
  47.   void read_allocation (Ibitstream *, Header *, Crc16 *);
  48.   void read_scalefactor (Ibitstream *, Header *);
  49.   BOOL read_sampledata (Ibitstream *);
  50.   BOOL put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
  51. };
  52.  
  53.  
  54. // class for layer I subbands in joint stereo mode:
  55. class SubbandLayer1IntensityStereo : public SubbandLayer1
  56. {
  57. protected:
  58.   real channel2_scalefactor;
  59.  
  60. public:
  61.        SubbandLayer1IntensityStereo (uint32 subbandnumber);
  62.   void read_allocation (Ibitstream *stream, Header *header, Crc16 *crc)
  63.   {
  64.     SubbandLayer1::read_allocation (stream, header, crc);
  65.   }
  66.   void read_scalefactor (Ibitstream *, Header *);
  67.   BOOL read_sampledata (Ibitstream *stream)
  68.   {
  69.      return SubbandLayer1::read_sampledata (stream);
  70.   }
  71.   BOOL put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
  72. };
  73.  
  74.  
  75. // class for layer I subbands in stereo mode:
  76. class SubbandLayer1Stereo : public SubbandLayer1
  77. {
  78. protected:
  79.   uint32 channel2_allocation;
  80.   real     channel2_scalefactor;
  81.   uint32 channel2_samplelength;
  82.   real     channel2_sample;
  83.   real     channel2_factor, channel2_offset;
  84.  
  85. public:
  86.        SubbandLayer1Stereo (uint32 subbandnumber);
  87.   void read_allocation (Ibitstream *, Header *, Crc16 *);
  88.   void read_scalefactor (Ibitstream *, Header *);
  89.   BOOL read_sampledata (Ibitstream *);
  90.   BOOL put_next_sample (e_channels, SynthesisFilter *, SynthesisFilter *);
  91. };
  92.  
  93. #endif
  94.